C#中"手写"用什么控件

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:42:10
在C#中能定义什么控件.效果可以像"手写"那样.
鼠标按下后拖动有线.如何做
补充下:我的目的就是.你在面板上按下鼠标左键,有一个点.如果按下鼠标左键拖动,那些经过的点就成了一条线咯...直到松开左键停止.
效果就是MSN的聊天时的手写效果

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication67
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

Point[] p=new Point[0];
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
Array.Resize(ref p, p.Length + 1);
p[p.GetUpperBound(0)] = new Point(e.X, e.Y);
if (e.Button == MouseButtons.Left && p.Length > 1)
{
Graphics g = pictureBox1.CreateGraphics();
g.DrawLine(Pens.Red, p[p.GetUpperBound(0)], p[p.GetUpperBound(0)-1]);
}
}
}
}
//在picturebox控件中实现手写!